package com.yuanqiworld.vw.service;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.roo.addon.javabean.RooJavaBean;

import java.util.List;

@RooJavaBean
public class ApplicationConfig {


    private String modelPath;
    private String modelPreviewPath;
    private List<String> supportedLanguages;

    public String findModelFilename(String relativeFilename) {
        return FilenameUtils.concat(modelPath, relativeFilename);
    }

    public String findPreviewFilename(String relativeFilename) {
        return FilenameUtils.concat(getModelPreviewPath(), relativeFilename);
    }


    public String getModelPreviewPath() {
        if (StringUtils.isBlank(modelPreviewPath)) return modelPath;
        return this.modelPreviewPath;
    }
}
